# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatus do
  @moduledoc """


  ## Attributes

  *   `error` (*type:* `GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatusError.t`, *default:* `nil`) - [Output only] Fatal errors encountered during the queueing or provisioning phases of the ResizeRequest that caused the transition to the FAILED state. Contrary to the last_attempt errors, this field is final and errors are never removed from here, as the ResizeRequest is not going to retry.
  *   `lastAttempt` (*type:* `GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatusLastAttempt.t`, *default:* `nil`) - [Output only] Information about the last attempt to fulfill the request. The value is temporary since the ResizeRequest can retry, as long as it's still active and the last attempt value can either be cleared or replaced with a different error. Since ResizeRequest retries infrequently, the value may be stale and no longer show an active problem. The value is cleared when ResizeRequest transitions to the final state (becomes inactive). If the final state is FAILED the error describing it will be storred in the "error" field only.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :error =>
            GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatusError.t() | nil,
          :lastAttempt =>
            GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatusLastAttempt.t()
            | nil
        }

  field(:error, as: GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatusError)

  field(:lastAttempt,
    as: GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatusLastAttempt
  )
end

defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatus do
  def decode(value, options) do
    GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatus.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatus do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
